package com.mycom.service.impl;

import com.mycom.dao.TeamSaveItemDao;
import com.mycom.pojo.TeamSaveItem;
import com.mycom.service.TeamSaveItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeamSaveItemServiceImpl implements TeamSaveItemService {
    @Autowired
    private TeamSaveItemDao teamSaveItemDao;

    @Override
    public boolean save(TeamSaveItem teamSaveItem) {
        return teamSaveItemDao.save(teamSaveItem) > 0 ? true : false;
    }

    @Override
    public List<TeamSaveItem> findByFormId(Integer formId) {
        return teamSaveItemDao.findByFormId(formId);
    }

    @Override
    public boolean deleteByFormId(Integer formId) {
        return teamSaveItemDao.deleteByFormId(formId) >=0 ? true : false;
    }

    @Override
    public boolean update(TeamSaveItem teamSaveItem) {
        return teamSaveItemDao.update(teamSaveItem) > 0 ? true : false;
    }

    @Override
    public boolean deleteById(Integer id) {
        return teamSaveItemDao.deleteById(id) > 0 ? true : false;
    }
}
